import type { RouteRecordRaw } from 'vue-router';
import {renderIcon} from "@/utils";
import {DatabaseOutlined} from "@vicons/antd";
import {Layout} from "@/router/constant";
const routes: Array<RouteRecordRaw> = [
  {
    path: '/data-center',
    name: 'DataCenter',
    redirect: '/data-center/alarm_history',
    component: Layout,
    meta: {
      title: '数据中心',
      icon: renderIcon(DatabaseOutlined),
      sort: 2,
      breadcrumb: true,  // 添加面包屑导航
    },
    children: [
      {
        path: 'alarm_history',
        name: 'DataCenterAlarm',
        component: () => import('@/views/data-center/alarm_history/alarm_history.vue'),
        meta: {
          title: '告警记录',
          keepAlive: true,
          requiresAuth: true,  // 需要登录
          permission: 'data-center:alarm_history',  // 权限控制
        },
      },
      {
        path: 'pushed_history',
        name: 'DataCenterPush',
        component: () => import('@/views/data-center/pushed_history/pushed_history.vue'),
        meta: {
          title: '推送记录',
          keepAlive: true,
          requiresAuth: true,  // 需要登录
          permission: 'data-center:pushed_history',  // 权限控制
        },
      },
    ],
  },
];

export default routes;
